<?php

function tsts_general_add_settings() {
// Add a form section for the Header settings
add_settings_section('tsts_settings_general_header', 'Header Options', 'tsts_settings_general_header_section_text', 'tsts');

// Add a form section for the Footer settings
add_settings_section('tsts_settings_general_footer', 'Footer Options', 'tsts_settings_general_footer_section_text', 'tsts');


// Add Header Navigation Menu Position setting to the Header section
add_settings_field('tsts_setting_header_nav_menu_position', 'Header Nav Menu Position', 'tsts_setting_header_nav_menu_position', 'tsts', 'tsts_settings_general_header');

// Add Footer Credit Link setting to the Footer section
add_settings_field('tsts_setting_display_footer_credit', 'Footer Credit', 'tsts_setting_display_footer_credit', 'tsts', 'tsts_settings_general_footer');

}
add_action( 'admin_init', 'tsts_general_add_settings' );


// Header Settings Section
function tsts_settings_general_header_section_text() { ?>
     <p><?php _e( 'Manage Header options for the tsts Theme. Refer to the contextual help screen for descriptions and help regarding each theme option.', 'tsts' ); ?></p>
<?php }

// Footer Settings Section
function tsts_settings_general_footer_section_text() { ?>
     <p><?php _e( 'Manage Footer options for the tsts Theme. Refer to the contextual help screen for descriptions and help regarding each theme option.', 'tsts' ); ?></p>
<?php }


// Navigation Menu Position Setting
function tsts_setting_header_nav_menu_position() {
     $tsts_options = get_option( 'tsts_options' ); ?>
     <select name="tsts_options[header_nav_menu_position]">
          <option <?php selected( 'above' == $tsts_options['header_nav_menu_position'] ); ?> value="above">Above</option>
          <option <?php selected( 'below' == $tsts_options['header_nav_menu_position'] ); ?> value="below">Below</option>
     </select>
     <span class="description">Display header navigation menu above or below the site title/description?</span>
<?php }

// Display Footer Credit Setting
function tsts_setting_display_footer_credit() {
     $tsts_options = get_option( 'tsts_options' ); ?>
     <select name="tsts_options[display_footer_credit]">
          <option <?php selected( true == $tsts_options['display_footer_credit'] ); ?> value="true">Display</option>
          <option <?php selected( false == $tsts_options['display_footer_credit'] ); ?> value="false">Do Not Display</option>
     </select>
     <span class="description">Display a credit link in the footer? It's nice to be nice.</span>
<?php }




?>